import config as cfg
import requests
import cv2
from PIL import Image
import io
import base64
import matplotlib.pyplot as plt
import pprint
pp = pprint.PrettyPrinter(indent=4)
BASE_URL = "https://kcmj21es3e.execute-api.us-east-1.amazonaws.com/prod/v1/"
def encode_image(image):
buffered = io.BytesIO()
image.save(buffered, format="JPEG")
image64 = base64.b64encode(buffered.getvalue())
return image64.decode()
Authentication¶
response = requests.post(
BASE_URL + "/auth/token",
data={
"username": cfg.USERNAME,
"password": cfg.PASSWORD,
},
)
token = response.json()["access_token"]
headers = {"Authorization": "Bearer %s" % token}
Panoramics¶
# The image is converted to grayscale in the backend, so you can convert it before sending in order to save bandwidth.
panoramic_image = Image.open("images/panoramic0.jpg").convert("L")
Dentition Endpoint¶
Classify the panoramic radiography in either toothless, superior toothless, inferior toothless, mixed or "normal".
dentition_response = requests.post(
BASE_URL + "/panoramics/dentition",
json={
"base64_image": encode_image(panoramic_image),
},
headers=headers,
)
pdata = dentition_response.json()
pdata["entities"] = pdata["entities"][:4]
pp.pprint(pdata)
{ 'entities': [ { 'bbox': None,
'class_name': 'normal',
'contour': None,
'line': None,
'point': None,
'score': 1.0,
'tooth': None,
'type': 'dentition'},
{ 'bbox': None,
'class_name': 'superior_toothless',
'contour': None,
'line': None,
'point': None,
'score': 7.882013930426979e-10,
'tooth': None,
'type': 'dentition'},
{ 'bbox': None,
'class_name': 'mixed',
'contour': None,
'line': None,
'point': None,
'score': 2.5856181778971532e-11,
'tooth': None,
'type': 'dentition'},
{ 'bbox': None,
'class_name': 'inferior_toothless',
'contour': None,
'line': None,
'point': None,
'score': 1.471757177934352e-12,
'tooth': None,
'type': 'dentition'}],
'height': 1292,
'image_hash': None,
'width': 2444}
fig, ax = plt.subplots(figsize=(10, 10))
ax.imshow(panoramic_image, cmap="gray")
ax.axis("off");
Longaxis Endpoint¶
Returns a point coordinates for the crown and the root of every tooth in the panoramic image.
longaxis_response = requests.post(
BASE_URL + "/panoramics/longaxis",
json={
"base64_image": encode_image(panoramic_image),
},
headers=headers,
)
Output Sample¶
pdata = longaxis_response.json()
pdata["entities"] = pdata["entities"][:3]
pp.pprint(pdata)
{ 'entities': [ { 'bbox': None,
'class_name': '18_0',
'contour': None,
'line': None,
'point': [632.8214285714287, 553.7142857142857],
'score': 0.5159812122583389,
'tooth': None,
'type': 'longaxis'},
{ 'bbox': None,
'class_name': '18_1',
'contour': None,
'line': None,
'point': [611.0, 351.83928571428567],
'score': 0.5159812122583389,
'tooth': None,
'type': 'longaxis'},
{ 'bbox': None,
'class_name': '17_0',
'contour': None,
'line': None,
'point': [752.8392857142858, 594.0892857142857],
'score': 0.594242125749588,
'tooth': None,
'type': 'longaxis'}],
'height': 1292,
'image_hash': None,
'width': 2444}
Visualization¶
from vis import draw_longaxis_output
dimage = draw_longaxis_output(panoramic_image, longaxis_response.json()["entities"], draw_axis=True)
fig, ax = plt.subplots(figsize=(10, 10))
ax.imshow(dimage)
ax.axis("off");
Panorogram Endpoint¶
Returns the panorogram curves of the panoramic image.
panorogram_response = requests.post(
BASE_URL + "/panoramics/panorogram",
json={
"base64_image": encode_image(panoramic_image),
},
headers=headers,
)
Output Sample¶
pdata = panorogram_response.json()
pdata["entities"] = [{**p, "contour": p["contour"][:3]} for p in pdata["entities"][:2]]
pp.pprint(pdata)
{ 'entities': [ { 'bbox': None,
'class_name': 'ContMand',
'contour': [[150, 179], [149, 180], [148, 180]],
'line': None,
'point': None,
'score': None,
'tooth': None,
'type': 'panorogram'},
{ 'bbox': None,
'class_name': 'CanManDir',
'contour': [[386, 547], [385, 548], [384, 548]],
'line': None,
'point': None,
'score': None,
'tooth': None,
'type': 'panorogram'}],
'height': 1292,
'image_hash': None,
'width': 2444}
Visualization¶
from vis import draw_panorogram
dimage = draw_panorogram(panoramic_image, [[p["class_name"], p["contour"]] for p in panorogram_response.json()["entities"]])
fig, ax = plt.subplots(figsize=(10, 10))
ax.imshow(dimage)
ax.axis("off");
Metals Endpoint¶
Returns metal structures found on the panoramic image.
metals_response = requests.post(
BASE_URL + "/panoramics/metals",
json={
"base64_image": encode_image(panoramic_image),
},
headers=headers,
)
Sample Output¶
pp.pprint(metals_response.json())
{ 'entities': [ { 'bbox': [ 860.0716552734375,
624.821044921875,
1569.6455078125,
783.9153442382812],
'class_name': 'ortodontia',
'contour': None,
'line': None,
'point': None,
'score': 0.9565339088439941,
'tooth': None,
'type': 'metals'},
{ 'bbox': [ 800.822021484375,
469.63043212890625,
1654.4962158203125,
637.3797607421875],
'class_name': 'ortodontia',
'contour': None,
'line': None,
'point': None,
'score': 0.831466555595398,
'tooth': None,
'type': 'metals'}],
'height': 1292,
'image_hash': None,
'width': 2444}
Visualization¶
from vis import draw_bboxes
dimage = draw_bboxes(panoramic_image, metals_response.json()["entities"])
fig, ax = plt.subplots(figsize=(10, 10))
ax.imshow(dimage)
ax.axis("off");
Teeth Segmentation Endpoint¶
Return a segmentation mask in the form of a contour for each found tooth on the panoramic image.
teeth_segmentation_response = requests.post(
BASE_URL + "/panoramics/teeth-segmentation",
json={
"base64_image": encode_image(panoramic_image),
},
headers=headers,
)
Output Sample¶
teeth_segmentation_response
<Response [200]>
pdata = teeth_segmentation_response.json()
pdata["entities"] = [{**p, "contour": p["contour"][:3]} for p in pdata["entities"][:3]]
pp.pprint(pdata)
{ 'entities': [ { 'bbox': None,
'class_name': '18',
'contour': [[608, 355], [607, 356], [606, 356]],
'line': None,
'point': None,
'score': None,
'tooth': None,
'type': 'teeth_segmentation'},
{ 'bbox': None,
'class_name': '17',
'contour': [[701, 370], [700, 371], [699, 371]],
'line': None,
'point': None,
'score': None,
'tooth': None,
'type': 'teeth_segmentation'},
{ 'bbox': None,
'class_name': '16',
'contour': [[828, 362], [827, 363], [826, 363]],
'line': None,
'point': None,
'score': None,
'tooth': None,
'type': 'teeth_segmentation'}],
'height': 1292,
'image_hash': None,
'width': 2444}
Visualization¶
from vis import contour2mask, draw_masks
contours_list = [[p["contour"]] for p in teeth_segmentation_response.json()["entities"]]
masks = [contour2mask(contour, *panoramic_image.size) for contour in contours_list]
dimage = draw_masks(panoramic_image, masks)
fig, ax = plt.subplots(figsize=(10, 10))
ax.imshow(dimage)
ax.axis("off");
Procedures Endpoint¶
Returns dental proceadures found on the panoramic image.
procedures_response = requests.post(
BASE_URL + "/panoramics/procedures",
json={
"base64_image": encode_image(panoramic_image),
},
headers=headers,
)
Output Sample¶
pdata = procedures_response.json()
pdata["entities"] = pdata["entities"][:1]
pp.pprint(pdata)
{ 'entities': [ { 'bbox': None,
'class_name': 'MatRestCoron',
'contour': None,
'line': [ [632.8214285714287, 553.7142857142857],
[611.0, 351.83928571428567]],
'point': None,
'score': 0.6624748706817627,
'tooth': '18',
'type': 'procedure'}],
'height': 1292,
'image_hash': None,
'width': 2444}
Visualization¶
from vis import draw_procedures_output
dimage = draw_procedures_output(panoramic_image, [e for e in procedures_response.json()["entities"] if e["score"] > 0.5])
fig, ax = plt.subplots(figsize=(12, 12))
ax.imshow(dimage)
ax.axis("off");
Describe Endpoint¶
The describe endpoint will return the result of all models at once.
The models can be called individually from the endpoints described in the docs.
describe_response = requests.post(
BASE_URL + "/panoramics/describe",
json={
"base64_image": encode_image(panoramic_image),
},
headers=headers,
)
Output Sample¶
pdata = describe_response.json()
pdata["entities"] = pdata["entities"][:3]
pp.pprint(pdata)
{ 'entities': [ { 'bbox': None,
'class_name': 'normal',
'contour': None,
'line': None,
'point': None,
'score': 1.0,
'tooth': None,
'type': 'dentition'},
{ 'bbox': None,
'class_name': 'superior_toothless',
'contour': None,
'line': None,
'point': None,
'score': 7.882013930426979e-10,
'tooth': None,
'type': 'dentition'},
{ 'bbox': None,
'class_name': 'mixed',
'contour': None,
'line': None,
'point': None,
'score': 2.5856181778971532e-11,
'tooth': None,
'type': 'dentition'}],
'height': 1292,
'image_hash': None,
'width': 2444}
Anomalies Heatmap Endpoint¶
Returns a heatmap of the anomalies found on the panoramic image.
anomalies_response = requests.post(
BASE_URL + "/panoramics/teeth-anomalies-heatmap",
json={
"base64_image": encode_image(panoramic_image),
},
headers=headers,
)
# Found classes:
for idx, data in enumerate(anomalies_response.json()):
if idx > 7:
break
if len(data["anomalies"]) == 0:
continue
print(f"Tooth {data['tooth_name']} Anomalies -" + ", ".join([anno["anomaly_name"] for anno in data["anomalies"]]), end=" ")
print("\n")
Tooth 18 Anomalies -NodP Tooth 17 Anomalies -Calc, NodP, Car Tooth 16 Anomalies -Calc, NodP, Car Tooth 13 Anomalies -Calc Tooth 12 Anomalies -Calc, Car Tooth 11 Anomalies -Calc, Car Tooth 21 Anomalies -Calc, Car
Visualization¶
Visualizing the Calc class.
from utils import process_ret_api
from vis import draw_heatmap
heatmap = process_ret_api(anomalies_response.json(), h=panoramic_image.height, w=panoramic_image.width, anomaly2see="Calc")
dimage = draw_heatmap(panoramic_image, heatmap)
fig, ax = plt.subplots(figsize=(10, 10))
ax.imshow(dimage)
ax.axis("off");
Periapicals¶
# The image is converted to grayscale in the backend, so you can convert it before sending in order to save bandwidth.
periapical_image = Image.open("images/periapical0.jpg").convert("L")
Classify Endpoint¶
The classify endpoint will return the periapical type among the 14 possible regions.
classify_response = requests.post(
BASE_URL + "/periapicals/classify",
json={
"base64_image": encode_image(periapical_image),
},
headers=headers,
)
Output Sample¶
pdata = classify_response.json()
pdata["entities"] = pdata["entities"][:4]
pp.pprint(pdata)
{ 'entities': [ { 'bbox': None,
'class_name': '42-41-31-32',
'contour': None,
'line': None,
'point': None,
'score': 0.9996941089630127,
'tooth': None,
'type': 'periapical_classification'},
{ 'bbox': None,
'class_name': '33',
'contour': None,
'line': None,
'point': None,
'score': 0.0002522027643863112,
'tooth': None,
'type': 'periapical_classification'},
{ 'bbox': None,
'class_name': '43',
'contour': None,
'line': None,
'point': None,
'score': 3.3788826840464026e-05,
'tooth': None,
'type': 'periapical_classification'},
{ 'bbox': None,
'class_name': '24-25',
'contour': None,
'line': None,
'point': None,
'score': 6.261640010052361e-06,
'tooth': None,
'type': 'periapical_classification'}],
'height': 1621,
'image_hash': None,
'width': 1236}
fig, ax = plt.subplots(figsize=(10, 10))
ax.imshow(periapical_image, cmap="gray")
ax.axis("off");
Longaxis Endpoit¶
Return the coordinates on the longaxis of each teeth found on the periapical image.
Sample Output¶
longaxis_response = requests.post(
BASE_URL + "/periapicals/longaxis",
json={
"base64_image": encode_image(periapical_image),
},
headers=headers,
)
pdata = longaxis_response.json()
pdata["entities"] = pdata["entities"][:3]
pp.pprint(pdata)
{ 'entities': [ { 'bbox': None,
'class_name': '43_1',
'contour': None,
'line': None,
'point': [135.1875, 1215.75],
'score': 0.05661439150571823,
'tooth': None,
'type': 'longaxis'},
{ 'bbox': None,
'class_name': '43_0',
'contour': None,
'line': None,
'point': [19.3125, 329.265625],
'score': 0.2382279932498932,
'tooth': None,
'type': 'longaxis'},
{ 'bbox': None,
'class_name': '42_1',
'contour': None,
'line': None,
'point': [299.34375, 1063.78125],
'score': 0.45180168747901917,
'tooth': None,
'type': 'longaxis'}],
'height': 1621,
'image_hash': None,
'width': 1236}
Visualization¶
from vis import draw_longaxis_output
dimage = draw_longaxis_output(
periapical_image, longaxis_response.json()["entities"], draw_axis=True, th=0.001
)
fig, ax = plt.subplots(figsize=(10, 10))
ax.imshow(dimage)
ax.axis("off");
Cephalometry¶
tele_image = Image.open("images/tele0.jpg").convert("L")
cefbot_response = requests.post(
BASE_URL + "/cephalometry/points",
json={
"base64_image": encode_image(tele_image),
},
headers=headers,
)
pdata = cefbot_response.json()
pdata["entities"] = pdata["entities"]
pp.pprint(pdata)
{ 'entities': [ { 'bbox': None,
'class_name': 'Nal',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1399.0, 448.0],
'score': 0.8843820691108704,
'tooth': None},
{ 'bbox': None,
'class_name': 'Na',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1326.0, 446.0],
'score': 0.8944681882858276,
'tooth': None},
{ 'bbox': None,
'class_name': 'Or',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1264.0, 764.0],
'score': 0.8249194622039795,
'tooth': None},
{ 'bbox': None,
'class_name': 'SO',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1268.0, 358.0],
'score': 0.8853605389595032,
'tooth': None},
{ 'bbox': None,
'class_name': 'S',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [613.0, 691.0],
'score': 0.837131917476654,
'tooth': None},
{ 'bbox': None,
'class_name': 'Si',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [617.0, 729.0],
'score': 0.8621986508369446,
'tooth': None},
{ 'bbox': None,
'class_name': 'Sp',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [562.0, 701.0],
'score': 0.8229628205299377,
'tooth': None},
{ 'bbox': None,
'class_name': 'Cls',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [529.0, 716.0],
'score': 0.8613099455833435,
'tooth': None},
{ 'bbox': None,
'class_name': 'Po',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [446.0, 899.0],
'score': 0.9982207417488098,
'tooth': None},
{ 'bbox': None,
'class_name': 'Cli',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [464.0, 1047.0],
'score': 0.9634029269218445,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ba',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [466.0, 1145.0],
'score': 0.9679994583129883,
'tooth': None},
{ 'bbox': None,
'class_name': 'Co',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [511.0, 934.0],
'score': 0.9279057383537292,
'tooth': None},
{ 'bbox': None,
'class_name': 'Bpc',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [493.0, 993.0],
'score': None,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ar',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [525.0, 1063.0],
'score': 0.920009434223175,
'tooth': None},
{ 'bbox': None,
'class_name': 'Bac',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [607.0, 975.0],
'score': 0.8744075298309326,
'tooth': None},
{ 'bbox': None,
'class_name': 'C',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [547.0, 984.0],
'score': 0.884807288646698,
'tooth': None},
{ 'bbox': None,
'class_name': 'Dc',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [580.0, 1052.0],
'score': 0.8354964256286621,
'tooth': None},
{ 'bbox': None,
'class_name': 'Go',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [630.0, 1442.0],
'score': 0.7658215165138245,
'tooth': None},
{ 'bbox': None,
'class_name': 'Me',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1369.0, 1848.0],
'score': 0.9910686016082764,
'tooth': None},
{ 'bbox': None,
'class_name': 'Pog',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1457.0, 1766.0],
'score': 0.9771527647972107,
'tooth': None},
{ 'bbox': None,
'class_name': 'Gn',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1432.0, 1846.0],
'score': 0.9764330983161926,
'tooth': None},
{ 'bbox': None,
'class_name': 'E',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1453.0, 1811.0],
'score': 0.9808403253555298,
'tooth': None},
{ 'bbox': None,
'class_name': 'B',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1399.0, 1611.0],
'score': 0.9440970420837402,
'tooth': None},
{ 'bbox': None,
'class_name': 'Id',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1422.0, 1501.0],
'score': 0.9752708673477173,
'tooth': None},
{ 'bbox': None,
'class_name': 'M',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1311.0, 1752.0],
'score': 0.9601864814758301,
'tooth': None},
{ 'bbox': None,
'class_name': 'Pm',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1422.0, 1688.0],
'score': 0.9710463881492615,
'tooth': None},
{ 'bbox': None,
'class_name': 'D',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1391.0, 1752.0],
'score': 0.944442868232727,
'tooth': None},
{ 'bbox': None,
'class_name': 'A',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1399.0, 1112.0],
'score': 0.9633007049560547,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ena',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1441.0, 1049.0],
'score': 0.930934488773346,
'tooth': None},
{ 'bbox': None,
'class_name': 'Pli',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1394.0, 1047.0],
'score': 0.9786720275878906,
'tooth': None},
{ 'bbox': None,
'class_name': 'Enp',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [904.0, 1152.0],
'score': 0.9545427560806274,
'tooth': None},
{ 'bbox': None,
'class_name': 'Cm',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1230.0, 606.0],
'score': None,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ptm',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [827.0, 786.0],
'score': 0.8410542011260986,
'tooth': None},
{ 'bbox': None,
'class_name': 'PVT',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [862.0, 844.0],
'score': 0.8377971649169922,
'tooth': None},
{ 'bbox': None,
'class_name': 'Vasa',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [804.0, 1241.0],
'score': 0.769838809967041,
'tooth': None},
{ 'bbox': None,
'class_name': 'Vasp',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [656.0, 1062.0],
'score': 0.853035569190979,
'tooth': None},
{ 'bbox': None,
'class_name': 'Vaia',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [720.0, 1529.0],
'score': 0.9060331583023071,
'tooth': None},
{ 'bbox': None,
'class_name': 'Vaip',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [607.0, 1497.0],
'score': 0.8944794535636902,
'tooth': None},
{ 'bbox': None,
'class_name': 'Xi',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [733.0, 1289.0],
'score': 0.822385311126709,
'tooth': None},
{ 'bbox': None,
'class_name': 'Bar',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [897.0, 1272.0],
'score': 0.8764723539352417,
'tooth': None},
{ 'bbox': None,
'class_name': 'D6s',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1033.0, 1371.0],
'score': 0.8088473081588745,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ams',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1122.0, 1218.0],
'score': 0.6533256769180298,
'tooth': None},
{ 'bbox': None,
'class_name': '6s',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1164.0, 1371.0],
'score': 0.8776930570602417,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ppd',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1062.0, 1368.0],
'score': 0.9407361745834351,
'tooth': None},
{ 'bbox': None,
'class_name': '6i',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1049.0, 1443.0],
'score': 0.47791945934295654,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ami',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [941.0, 1519.0],
'score': 0.32280850410461426,
'tooth': None},
{ 'bbox': None,
'class_name': 'A4',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1285.0, 1618.0],
'score': 0.8410146236419678,
'tooth': None},
{ 'bbox': None,
'class_name': 'C4',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1281.0, 1402.0],
'score': 0.9355712532997131,
'tooth': None},
{ 'bbox': None,
'class_name': 'PAR',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1289.0, 1409.0],
'score': 0.9403156042098999,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ap',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1250.0, 1185.0],
'score': 0.9661611914634705,
'tooth': None},
{ 'bbox': None,
'class_name': '3s',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1344.0, 1404.0],
'score': 0.9152003526687622,
'tooth': None},
{ 'bbox': None,
'class_name': '3i',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1363.0, 1431.0],
'score': 0.8229315280914307,
'tooth': None},
{ 'bbox': None,
'class_name': 'Aii',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1371.0, 1584.0],
'score': 0.9082520008087158,
'tooth': None},
{ 'bbox': None,
'class_name': 'Iii',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1397.0, 1368.0],
'score': 0.9032456278800964,
'tooth': None},
{ 'bbox': None,
'class_name': 'Iis',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1492.0, 1458.0],
'score': 0.7410860657691956,
'tooth': None},
{ 'bbox': None,
'class_name': 'Sf1',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1504.0, 1419.0],
'score': 0.68467116355896,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ais',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1390.0, 1218.0],
'score': 0.7089275121688843,
'tooth': None},
{ 'bbox': None,
'class_name': 'Pogl',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1611.0, 1728.0],
'score': 0.9235056638717651,
'tooth': None},
{ 'bbox': None,
'class_name': 'Bl',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1545.0, 1566.0],
'score': 0.9972298741340637,
'tooth': None},
{ 'bbox': None,
'class_name': 'Li',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1619.0, 1476.0],
'score': 0.8844496011734009,
'tooth': None},
{ 'bbox': None,
'class_name': 'Stm',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1545.0, 1404.0],
'score': 0.8447850942611694,
'tooth': None},
{ 'bbox': None,
'class_name': 'Ls',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1586.0, 1305.0],
'score': 0.9416882395744324,
'tooth': None},
{ 'bbox': None,
'class_name': 'Al',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1553.0, 1251.0],
'score': 0.8138983249664307,
'tooth': None},
{ 'bbox': None,
'class_name': 'Sn',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1537.0, 1143.0],
'score': 0.876266360282898,
'tooth': None},
{ 'bbox': None,
'class_name': 'Prn',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1636.0, 1107.0],
'score': 0.8103563189506531,
'tooth': None},
{ 'bbox': None,
'class_name': 'Pn',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1710.0, 999.0],
'score': 0.8813038468360901,
'tooth': None},
{ 'bbox': None,
'class_name': 'V',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1386.0, 1783.0],
'score': 0.9141018390655518,
'tooth': None},
{ 'bbox': None,
'class_name': 'T',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1371.0, 1591.0],
'score': 0.9562093019485474,
'tooth': None},
{ 'bbox': None,
'class_name': 'Tuber',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [899.0, 1252.0],
'score': 0.923416256904602,
'tooth': None},
{ 'bbox': None,
'class_name': 'Pi',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1461.0, 1289.0],
'score': 0.8999700546264648,
'tooth': None},
{ 'bbox': None,
'class_name': 'PTVR',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [818.0, 878.0],
'score': 0.8683756589889526,
'tooth': None},
{ 'bbox': None,
'class_name': 'LN',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [1523.0, 740.0],
'score': 0.9340992569923401,
'tooth': None},
{ 'bbox': None,
'class_name': 'PPM',
'contour': None,
'line': None,
'model_name': 'cefalometry',
'point': [708.0, 1469.0],
'score': 0.9267994165420532,
'tooth': None}],
'image_hash': None,
'model_name': 'cefalometry',
'output_height': 2304,
'output_width': 2104}
Visualization¶
from vis import draw_points
dimage = draw_points(tele_image, cefbot_response.json()["entities"])
fig, ax = plt.subplots(figsize=(14, 14))
ax.imshow(dimage)
ax.axis("off");